import { PermissionType } from "@/model/frame/IPermissionConfig";
import FrameConfig from "@/model/frame/FrameConfig";

export interface IPermissionItem {
  Code: string;
  Name: string;
  Description: string;
  Type: PermissionType;
  Children?: IPermissionItem[];
}

const PermissionData: IPermissionItem[] = [
  {
    Code: `DIR:${FrameConfig.APP_NAME}:RBACManage`,
    Name: "RBAC管理",
    Description: "包括角色、用户和权限的控制和查看",
    Type: PermissionType.DIR,
    Children: [
      {
        Code: `ROUTE:${FrameConfig.APP_NAME}:UserManage`,
        Name: "用户管理",
        Description: "用户的增删改查",
        Type: PermissionType.ROUTE,
        Children: [
          {
            Code: "RBAC:User:List",
            Name: "用户查看",
            Description: "可以检索用户",
            Type: PermissionType.RESOURCE
          },
          {
            Code: "RBAC:User:Create",
            Name: "用户新增",
            Description: "新增用户",
            Type: PermissionType.RESOURCE
          },
          {
            Code: "RBAC:User:Delete",
            Name: "用户删除",
            Description: "可以删除用户",
            Type: PermissionType.RESOURCE
          },
          {
            Code: "RBAC:User:Update",
            Name: "用户更新",
            Description: "可以更新用户",
            Type: PermissionType.RESOURCE
          }
        ]
      }
    ]
  }
];

export default PermissionData;
